home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3581 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.6 KB

  1. Path: nntphost.dur.ac.uk!nntp
  2. From: Rory Barr <R.J.Barr@durham.ac.uk>
  3. Newsgroups: comp.lang.c++
  4. Subject: Templates and linker errors
  5. Date: Wed, 24 Jan 1996 23:26:50 +0000
  6. Organization: University of Durham, Durham, UK.
  7. Message-ID: <3106C03A.6553@durham.ac.uk>
  8. NNTP-Posting-Host: geotech1.dur.ac.uk
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0b5 (Win95; I)
  13.  
  14. I am using Borland 4.5. The code I am writing makes quite extensive use 
  15. of container classes. However I have just come across a new error wish I 
  16. just can't get past. With a deadline looming I am desperate for some 
  17. help.
  18.  
  19. The error occurs on the second pass of the linker and is
  20.  
  21. Linker Error: Undefined symbol TMISetAsVector<TRCondition, 
  22. TStandardAllocator>::Add(TRCondition far*) in module BLAH.CPP
  23.  
  24. However if I create a seperate project and create a countainer of 
  25. TRCondition objects and some code that uses Add(T*) it links fine.
  26.  
  27. The problem appears to be in the creation of template instances. 
  28. TRCondition is not the only class I get this error, and I also get 
  29. similar errors for the functions Detach() and Find(), however some other 
  30. similar classes link fine. If I change the template options 
  31. (Options|Project|C++ options|templates) to get the compliler to 
  32. generate external references to all the instances I get this same error 
  33. for all the classes I've used that container class with. If I set it to 
  34. use global definitions it comes back with hundreds of redefinition 
  35. errors.
  36.  
  37. Does anybody have any ideas how to get round this problem.
  38.  
  39. Rory.
  40.  
  41. please email me as well as posting replies, mailto:R.J.Barr@durham.ac.uk
  42.